$(function(){
	new Vue({
		el:"#registerUserApp",
		data:{
			currentPage:1,
			fullscreenLoading:false,
			totalSize:1,
			tableData: [{
				date: '2016-05-02',
				name: '王小虎',
				phone:"",
				meal:"男",
				goodPic:"../../image/default_people_ico.png",
				address: '上海市普陀区金沙江路 1518 弄'
			}],
		},
		created:function(){
			parent.vueData.$data.hreHtml = "../registerUser/index.html";
			parent.vueData.activeIndex = "2";
			parent.vueData.getLeftNav("2")
			parent.vueData.$data.categoryIndex = 1
		   	this.getNewUser(1);
		},
		methods:{
			getNewUser(page){
				this.fullscreenLoading = true;
				let param = {
					page:page,
				}
				axios({
					url: POSTURL.getNewUser,
					method: 'post',
					data: param
				}).then(response => {
					this.fullscreenLoading = false;
					if (response.data.code === 100) {
						if (page === 1) {
							if (response.data.result.page <=1) {
								this.totalSize = response.data.result.users.length
							} else {
								this.totalSize = response.data.result.page * 10
							}
							this.tableData.length = 0;
							this.tableData = [];
						}
						this.tableData = this.tableData.concat(response.data.result.users)
					} else {
						this.$message.error(response.data.message);
					}
				}).catch(error => {
					this.fullscreenLoading = false;
					console.log(error);
					this.$message.error('服务器出错!');
				})
			},
			handleCurrentChange(val) {
				this.getNewUser(val);
			},
		}
	})
})